/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.jeesite.modules.goods.entity;

import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.JoinTable;
import com.jeesite.common.mybatis.annotation.JoinTable.Type;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;
import com.jeesite.modules.xcxAdmin.entity.ZtAdmin;

/**
 * 测试数据Entity
 * 
 * @author ThinkGem
 * @version 2018-04-22
 */
@Table(name = "zt_quanself", alias = "a", columns = {
		@Column(name = "id", attrName = "id", label = "编号", isPK = true),
		@Column(name = "quan_id", attrName = "ztQuan.id", label = "券id"),
		@Column(name = "admin_id", attrName = "ztAdmin.id", label = "小程序用户id"),
		@Column(name = "status", attrName = "status", label = "状态"),
		@Column(name = "usestatus", attrName = "usestatus", label = "券的使用状态"),
		@Column(name = "create_date", attrName = "createDate", label = "创建时间"),

}, joinTable = {
		@JoinTable(type = Type.LEFT_JOIN, entity = ZtAdmin.class, attrName = "ztAdmin", alias = "z", on = "z.id = a.admin_id", columns = {
				@Column(name = "name", attrName = "name", label = "小程序名称", queryType = QueryType.LIKE),
				@Column(name = "headimgurl", label = "小程序头像", attrName = "headimgurl"), }),
		@JoinTable(type = Type.LEFT_JOIN, entity = ZtQuan.class, attrName = "ztQuan", alias = "q", on = "q.id = a.quan_id", columns = {
				@Column(name = "type", label = "券的类型"),
				@Column(name = "price", label = "券的价值"),
				@Column(name = "edu", label = "券的满额"),
				@Column(name = "img", label = "图片"),
				@Column(name = "level_range", attrName = "levelRange", label = "发券人范围"),
				@Column(name = "usetotal", attrName = "usetotal", label = "已使用的券数"),
				@Column(name = "usestatus", label = "券是否有效"),			
				@Column(name = "over_count",attrName="overCount", label = "剩余"),
				@Column(name = "to_time",attrName="toTime", label = "到期时间"),
				@Column(name = "name", label = "券名", attrName = "name", queryType = QueryType.LIKE), })

}, orderBy = "a.create_date DESC")
public class ZtQuanself extends DataEntity<ZtQuanself> {

	private static final long serialVersionUID = 1L;

	private ZtQuan ztQuan;
	private ZtAdmin ztAdmin;
	private String status;
	private String usestatus;
	private Date createDate;
	
	@JsonIgnore
	private String updateBy;
	@JsonIgnore
	private String createBy;
	@JsonIgnore
	private Date updateDate;

	public ZtQuan getZtQuan() {
		return ztQuan;
	}

	public void setZtQuan(ZtQuan ztQuan) {
		this.ztQuan = ztQuan;
	}
	@JsonIgnore
	public ZtAdmin getZtAdmin() {
		return ztAdmin;
	}

	public void setZtAdmin(ZtAdmin ztAdmin) {
		this.ztAdmin = ztAdmin;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public String getUsestatus() {
		return usestatus;
	}

	public void setUsestatus(String usestatus) {
		this.usestatus = usestatus;
	}
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

}